Skip to content

Add simplified architecture diagrams for traffic flow and config changes #3557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sarthyparty
Copy link
Contributor

@sarthyparty sarthyparty commented Jun 26, 2025

Proposed changes

Add simplified architecture diagrams for traffic flow and config changes.

Problem: The current architecture documentation for NGF is written and presented in a way for a new user or developer to be able to understand.

Solution: Adding new diagrams and explanations for how traffic flows and how config changes are applied and the lifecycle of a gateway.

Please focus on (optional): If you any specific areas where you would like reviewers to focus their attention or provide
specific feedback, add them here.

Closes #3545

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.


Copy link

nginx-bot bot commented Jun 26, 2025

Hi @sarthyparty!

Thanks for opening this pull request!
Be sure to check out our Contributing Guidelines while you wait for someone on the team to review this.

@nginx-bot nginx-bot bot added the community label Jun 26, 2025
@github-actions github-actions bot added documentation Improvements or additions to documentation chore Pull requests for routine tasks labels Jun 26, 2025
Copy link
Contributor

github-actions bot commented Jun 26, 2025

✅ All required contributors have signed the F5 CLA for this PR. Thank you!
Posted by the CLA Assistant Lite bot.

@sarthyparty
Copy link
Contributor Author

I have hereby read the F5 CLA and agree to its terms

@salonichf5 salonichf5 assigned sarthyparty and unassigned ciarams87 Jun 30, 2025
@salonichf5 salonichf5 moved this from 🆕 New to 👀 In Review in NGINX Gateway Fabric Jun 30, 2025
@sarthyparty sarthyparty marked this pull request as ready for review July 1, 2025 15:03
@sarthyparty sarthyparty requested review from a team as code owners July 1, 2025 15:03
sarthyparty and others added 2 commits July 3, 2025 09:28
Co-authored-by: salonichf5 <146118978+salonichf5@users.noreply.github.com>
Co-authored-by: salonichf5 <146118978+salonichf5@users.noreply.github.com>
@salonichf5
Copy link
Contributor

can we rename the folder to simplified-architecture?

Comment on lines +59 to +62
- **Gateway**: Defines entry points for traffic
- **HTTPRoute**: Defines HTTP routing rules
- **GRPCRoute**: Defines gRPC routing rules
- **TLSRoute**: Defines TLS routing rules
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also implement BackendTLSPolicy and GatewayClass. To avoid having to keep updating this list as more resources get added, we could link to https://docs.nginx.com/nginx-gateway-fabric/overview/gateway-api-compatibility/ instead.


### Control Plane Security

- **Full Kubernetes API access** (to watch resources)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not technically full access. We use RBAC to limit to just the resources and permissions we care about.

@@ -0,0 +1,83 @@
# NGINX Gateway Fabric Architecture

This guide explains how NGINX Gateway Fabric works in simple terms.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could also be worth linking to https://docs.nginx.com/nginx-gateway-fabric/overview/gateway-architecture/ for more details on the architecture.

Comment on lines +126 to +129
- **nginx.conf**: Main configuration
- **servers.conf**: Virtual server definitions
- **upstreams.conf**: Backend service definitions
- **maps.conf**: Request routing maps
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't technically the conf files that we generate. It's an ever-changing list, so I wouldn't bother listing them here.

Comment on lines +7 to +38
```mermaid
%%{init: {'theme':'dark', 'themeVariables': {'fontSize': '16px', 'darkMode': true, 'primaryColor': '#4f46e5', 'primaryTextColor': '#e5e7eb', 'primaryBorderColor': '#6b7280', 'lineColor': '#9ca3af', 'secondaryColor': '#1f2937', 'tertiaryColor': '#374151', 'background': '#111827', 'mainBkg': '#1f2937', 'secondBkg': '#374151', 'tertiaryTextColor': '#d1d5db'}}}%%
graph LR
%% Simple traffic flow
USER[👤 User]

subgraph "Kubernetes Cluster"
NGINX[🌐 NGINX]

subgraph "Your Apps"
SVC1[🔵 user-service]
SVC2[🔵 order-service]
POD1[Pod A]
POD2[Pod B]
POD3[Pod C]
end
end

%% Simple flow
USER --> NGINX
NGINX --> SVC1
NGINX --> SVC2
SVC1 --> POD1
SVC1 --> POD2
SVC2 --> POD3

%% Dark-friendly styling
style USER fill:#fbbf24,stroke:#f59e0b,stroke-width:2px,color:#1f2937
style NGINX fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff
style SVC1 fill:#10b981,stroke:#059669,stroke-width:2px,color:#ffffff
style SVC2 fill:#10b981,stroke:#059669,stroke-width:2px,color:#ffffff
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nginx technically routes directly to the Pods, not through the Service. We use the Service to get information about the Pods.

```text
NGINX Gateway:
├── Receives request from user
├── Applies SSL termination
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(only if a user configures it to do so)

Comment on lines +104 to +139
### Path-Based Routing

```nginx
# Generated from HTTPRoute resources
location /users {
proxy_pass http://user-service;
}

location /orders {
proxy_pass http://order-service;
}

location /products {
proxy_pass http://product-service;
}
```


### Host-Based Routing

```nginx
# Different hosts route to different services
server {
server_name api.example.com;
location / {
proxy_pass http://api-service;
}
}

server {
server_name admin.example.com;
location / {
proxy_pass http://admin-service;
}
}
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be combined. Every route we perform uses both a hostname and a path.

Comment on lines +63 to +70
```text
Resources Created:
├── Deployment: nginx-gateway-{gateway-name}
├── Service: nginx-gateway-{gateway-name}
├── ConfigMap: nginx-config-{gateway-name}
├── ServiceAccount: nginx-gateway-{gateway-name}
└── Secrets: TLS certificates (if needed)
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a handful of others resources we create. I don't expect them to all be listed, but I don't want a dev to be confused and think that this list is all we create.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks community documentation Improvements or additions to documentation
Projects
Status: 👀 In Review
Development

Successfully merging this pull request may close these issues.

User and Contributor Oriented Architecture Guides
4 participants